package com.jymj.entity.landmanage;

import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * Created by ${lc} on 2020/12/14. 按镇统计分
 */
@Accessors(chain = true)
public class ScoreZhenEntity {
    private String zhen;
    private String zhencode;
    private Integer cunCounts;//村数量
    private Integer wts;//村本月和以前遗留的问题数
    private Integer zfs;//总分数
    private Integer szfs;//上月总分数
    private Integer scounts;//上月村庄数
    private BigDecimal monaverage;//当月平均分
    private BigDecimal smonaverage;//上月平均分
    private BigDecimal hbqk;//环比情况  当月平均分减上月平均分
    private Integer bfCun;//百分村庄数量;
    private Integer jsCun;//九十到九十九村庄数量;
    private Integer bsCun;//八十到八十九村庄数量;
    private Integer qualified;//合格村庄数量
    private Integer unqualified;//不合格村庄数量
    private BigDecimal percent;//合格率
    private Integer zwts;//总问题数
    private Integer clwts;//处理问题数
    private BigDecimal cjwts;//村均问题数
    private Integer hjwts;//影响环境问题数
    private Integer gcwts;//公厕问题数
    private Integer ljwts;//垃圾治理问题数
    private Integer wswts;//污水治理问题数
    private Integer ldlfwts;//乱堆乱放问题数
    private Integer ltlhwts;//乱贴乱画问题数
    private Integer sdljwts;//私搭乱建问题数
    private Integer gcwtshg;//整改完公厕问题数
    private Integer ljwtshg;//整改完垃圾治理问题数
    private Integer wswtshg;//整改完污水治理问题数
    private Integer ldlfwtshg;//整改完乱堆乱放问题数
    private Integer ltlhwtshg;//整改完乱贴乱画问题数
    private Integer sdljwtshg;//整改完私搭乱建问题数
    private Integer zhgs;//整改完问题数
    private BigDecimal zgl;//整改率
    private Integer pjfCount;//计算总平均分是所需总数

    public void setPjfCount(Integer pjfCount) {
        this.pjfCount = pjfCount;
    }

    public Integer getPjfCount() {
        return pjfCount == null ? 0 : pjfCount;
    }

    public Integer getClwts() {
        return clwts;
    }

    public void setClwts(Integer clwts) {
        this.clwts = clwts;
    }

    public BigDecimal getZgl() {
        return (getZwts() == null || getZwts() == 0)? BigDecimal.valueOf(0) : (
                (getZhgs() == null || getZhgs() == 0) ? BigDecimal.valueOf(0) : BigDecimal.valueOf(getZhgs()).divide(
                        BigDecimal.valueOf(getZwts()),3,RoundingMode.HALF_UP
                ));
    }

    public Integer getZhgs() {
        return zhgs == null ? 0 : zhgs;
    }

    public void setZhgs(Integer zhgs) {
        this.zhgs = zhgs;
    }

    public Integer getGcwtshg() {
        return gcwtshg;
    }

    public void setGcwtshg(Integer gcwtshg) {
        this.gcwtshg = gcwtshg;
    }

    public Integer getLjwtshg() {
        return ljwtshg;
    }

    public void setLjwtshg(Integer ljwtshg) {
        this.ljwtshg = ljwtshg;
    }

    public Integer getWswtshg() {
        return wswtshg;
    }

    public void setWswtshg(Integer wswtshg) {
        this.wswtshg = wswtshg;
    }

    public Integer getLdlfwtshg() {
        return ldlfwtshg;
    }

    public void setLdlfwtshg(Integer ldlfwtshg) {
        this.ldlfwtshg = ldlfwtshg;
    }

    public Integer getLtlhwtshg() {
        return ltlhwtshg;
    }

    public void setLtlhwtshg(Integer ltlhwtshg) {
        this.ltlhwtshg = ltlhwtshg;
    }

    public Integer getSdljwtshg() {
        return sdljwtshg;
    }

    public void setSdljwtshg(Integer sdljwtshg) {
        this.sdljwtshg = sdljwtshg;
    }

    public Integer getZfs() {
        return zfs;
    }

    public void setZfs(Integer zfs) {
        this.zfs = zfs;
    }

    public Integer getSzfs() {
        return szfs;
    }

    public void setSzfs(Integer szfs) {
        this.szfs = szfs;
    }

    public Integer getScounts() {
        return scounts;
    }

    public void setScounts(Integer scounts) {
        this.scounts = scounts;
    }

    public Integer getZwts() {
        return zwts == null ? 0 : zwts;
    }

    public void setZwts(Integer zwts) {
        this.zwts = zwts;
    }

    public BigDecimal getCjwts() {
        return getPjfCount() == 0 ? BigDecimal.ZERO : (getZwts() == 0 ? BigDecimal.ZERO : BigDecimal.valueOf(getZwts())
                .divide(BigDecimal.valueOf(getPjfCount()),4,RoundingMode.HALF_UP));
    }

    public void setCjwts(BigDecimal cjwts) {
        this.cjwts = cjwts;
    }

    public Integer getHjwts() {
        return hjwts;
    }

    public void setHjwts(Integer hjwts) {
        this.hjwts = hjwts;
    }

    public Integer getGcwts() {
        return gcwts;
    }

    public void setGcwts(Integer gcwts) {
        this.gcwts = gcwts;
    }

    public Integer getLjwts() {
        return ljwts;
    }

    public void setLjwts(Integer ljwts) {
        this.ljwts = ljwts;
    }

    public Integer getWswts() {
        return wswts;
    }

    public void setWswts(Integer wswts) {
        this.wswts = wswts;
    }

    public Integer getLdlfwts() {
        return ldlfwts;
    }

    public void setLdlfwts(Integer ldlfwts) {
        this.ldlfwts = ldlfwts;
    }

    public Integer getLtlhwts() {
        return ltlhwts;
    }

    public void setLtlhwts(Integer ltlhwts) {
        this.ltlhwts = ltlhwts;
    }

    public Integer getSdljwts() {
        return sdljwts;
    }

    public void setSdljwts(Integer sdljwts) {
        this.sdljwts = sdljwts;
    }

    public String getZhen() {
        return zhen;
    }

    public void setZhen(String zhen) {
        this.zhen = zhen;
    }

    public String getZhencode() {
        return zhencode;
    }

    public void setZhencode(String zhencode) {
        this.zhencode = zhencode;
    }

    public Integer getCunCounts() {
        return cunCounts == null ? 0 : cunCounts;
    }

    public void setCunCounts(Integer cunCounts) {
        this.cunCounts = cunCounts;
    }

    public Integer getWts() {
        return wts;
    }

    public void setWts(Integer wts) {
        this.wts = wts;
    }

    public BigDecimal getMonaverage() {
        return (getPjfCount() == null || getPjfCount() == 0) ? BigDecimal.valueOf(0) : (
                (getZfs() == null || getZfs() == 0) ? BigDecimal.valueOf(0) : BigDecimal.valueOf(getZfs())
                        .divide(BigDecimal.valueOf(getPjfCount()),2,RoundingMode.HALF_UP)
                );
    }

    public void setMonaverage(BigDecimal monaverage) {
        this.monaverage = monaverage;
    }

    public BigDecimal getSmonaverage() {
        return (getScounts() == null || getScounts() == 0) ? BigDecimal.valueOf(0) : (
                (getSzfs() == null || getSzfs() == 0) ? BigDecimal.valueOf(0) : BigDecimal.valueOf(getSzfs())
                        .divide(BigDecimal.valueOf(getScounts()),2,RoundingMode.HALF_UP)
        );
    }

    public void setSmonaverage(BigDecimal smonaverage) {
        this.smonaverage = smonaverage;
    }

    public BigDecimal getHbqk() {
        return getMonaverage().subtract(getSmonaverage());
    }

    public void setHbqk(BigDecimal hbqk) {
        this.hbqk = hbqk;
    }

    public Integer getBfCun() {
        return bfCun;
    }

    public void setBfCun(Integer bfCun) {
        this.bfCun = bfCun;
    }

    public Integer getJsCun() {
        return jsCun;
    }

    public void setJsCun(Integer jsCun) {
        this.jsCun = jsCun;
    }

    public Integer getBsCun() {
        return bsCun;
    }

    public void setBsCun(Integer bsCun) {
        this.bsCun = bsCun;
    }

    public Integer getQualified() {
        return qualified == null ? 0 : qualified;
    }

    public void setQualified(Integer qualified) {
        this.qualified = qualified;
    }

    public Integer getUnqualified() {
        return unqualified == null ? 0 : unqualified;
    }

    public void setUnqualified(Integer unqualified) {
        this.unqualified = unqualified;
    }

    public BigDecimal getPercent() {
        return  (getPjfCount() == null || getPjfCount() == 0)?  BigDecimal.valueOf(0):
                (getQualified() == null ? BigDecimal.valueOf(0) : BigDecimal.valueOf(getQualified())
                        .divide(BigDecimal.valueOf(getPjfCount()),3,RoundingMode.HALF_UP));
    }

    public void setPercent(BigDecimal percent) {
        this.percent = percent;
    }
}
